signalFile = fopen('filled_signal.txt', 'r');
noisedSignalFile = fopen('noised_signal.txt', 'r');
spectrumFile = fopen('spectrum.txt', 'r');
filteredSpectrum = fopen('filtered_spectrum.txt', 'r');
filteredSignal = fopen('filtered_signal.txt', 'r');

sf = fscanf(signalFile, '%f \t %f', [2, inf]);
nsf = fscanf(noisedSignalFile, '%f \t %f', [2, inf]);
spf = fscanf(spectrumFile, '%f \t %f', [2, inf]);
fsp = fscanf(filteredSpectrum, '%f \t %f', [2, inf]);
fs = fscanf(filteredSignal, '%f \t %f', [2, inf]);

%Window Maximization -
%http://www.tech.plym.ac.uk/spmc/links/matlab/matlab_tips.html

screen=get(0,'screensize');
if screen(3)==800
 set(gcf,'Units','normalized','Position',[0 0.0467 1.00 0.84])
elseif screen(3)==1024
 set(gcf,'Units','normalized','Position',[0.00 0.032 1.00 0.92])
elseif screen(3)==1152
 set(gcf,'Units','normalized','Position',[0.00 0.032 1.00 0.89])
elseif screen(3)==1280
 set(gcf,'Units','normalized','Position',[0.00 0.032 1.00 0.895])
elseif screen(3)==1600
 set(gcf,'Units','normalized','Position',[0.00 0.032 1.00 0.905])
end 

subplot(1,2,1)
title('Signal')
hold all
len = length(sf) - 1;
x = 0:1:len;
plot(sf(1,:), sf(2,:));
plot(nsf(1,:), nsf(2,:));
plot(fs(1,:), fs(2,:));
legend('signal', 'noised signal', 'filtered signal');
xlabel('[s]');

subplot(1,2,2)
title('Spectrum')
hold all
plot(spf(1,:), spf(2,:));
plot(fsp(1,:), fsp(2,:));
legend('noised signal spectrum', 'filtered spectrum');
xlabel('[Hz]');
pause
close all;